<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/kaoqin.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/personal.css"/>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics">
	<div class="larry-personal">
            <div class="layui-tab">
                <div class="layui-tab-item layui-field-box layui-show ">
                    <div class="userinfo" style="width:80%;margin: 10px auto;">
                        <a class="on top pointer" data-type="info">个人信息</a>
                        <a class="top pointer" data-type="account">账号与安全</a>
                        <div class="info">
                            <!-- 表单项 -->
                            <form class="layui-form" id="form1" action="">
                                <input type="hidden" name='user_id' value='{$userinfo.user_id}'>
                                <table class="table table-bordered">
                                    <colgroup>
                                        <col width="100">
                                        <col width="400">
                                    </colgroup>
                                    <thead>
                                        <tr>
                                            <td colspan="2">基本信息</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_008.png">姓名：</td>
                                            <td>
                                                <input name="user_name" size="10" maxlength="10" class="layui-input" value="{$userinfo.user_name}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_009.png">性别：</td>
                                            <td>
                                                <select name="sex" class="layui-input search_input" style="margin:0">
                                                    <option value="0" {$userinfo['sex'] == 0?'selected':''}>男</option>
                                                    <option value="1" {$userinfo['sex'] == 1?'selected':''}>女</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_010.png">生日：</td>
                                            <td>
                                                <select name="bir_year" id="BIR_YEAR_ID" class="layui-input search_input" onchange="get_animal_sign();" style="width:100px;margin:0;display:inline;">
                                                    <option value=""></option>
                                                    <foreach name="year" item="b_year">
                                                        <option value="{$b_year}" {$userinfo['b_year'] == $b_year?'selected':''}>{$b_year}</option>
                                                    </foreach>
                                                </select><span>年</span>
                                                <select name="bir_mon" id="BIR_MON_ID" class="layui-input search_input" onchange="get_animal_sign();" style="width:100px;display:inline;">
                                                    <option value=""></option>
                                                    <foreach name="month" item="b_month">
                                                        <option value="{$b_month}" {$userinfo['b_month'] == $b_month?'selected':''}>{$b_month}</option>
                                                    </foreach>
                                                </select><span>月</span>
                                                <select name="bir_day" id="BIR_DAY_ID" class="layui-input search_input" onchange="get_animal_sign()" ;="" style="width:100px;display:inline;">
                                                    <option value=""></option>
                                                    <foreach name="day" item="b_day">
                                                        <option value="{$b_day}" {$userinfo['b_day'] == $b_day?'selected':''}>{$b_day}</option>
                                                    </foreach>
                                                </select><span>日</span>
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_011.png">生肖：</td>
                                            <td>
                                                <input value="{$userinfo.zodiac}" id="animal_id" class="layui-input" readonly type="text" style="cursor: not-allowed;background-color: #eeeeee;">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_012.png">星座：</td>
                                            <td>
                                                <input value="{$userinfo.con}" id="sign_id" class="layui-input" readonly type="text" style="cursor: not-allowed;background-color: #eeeeee;">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table table-bordered">
                                    <colgroup>
                                        <col width="100">
                                        <col width="400">
                                    </colgroup>
                                    <thead>
                                        <tr>
                                            <td colspan="2">联系方式</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_014.png">工作电话：</td>
                                            <td>
                                                <input name="tel_no_dept" size="25" maxlength="25" class="layui-input" value="{$userinfo.tel_no_dept}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_015.png">工作传真：</td>
                                            <td>
                                                <input name="fax_no_dept" size="25" maxlength="25" class="layui-input" value="{$userinfo.fax_no_dept}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_016.png">手机：</td>
                                            <td>
                                                <input name="mobil_no" size="23" maxlength="23" class="layui-input" value="{$userinfo.mobil_no}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_017.png">电子邮件：</td>
                                            <td>
                                                <input name="email" size="25" maxlength="50" class="layui-input" value="{$userinfo.email}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_018.png">QQ号码：</td>
                                            <td>
                                                <input name="oicq_no" size="25" maxlength="25" class="layui-input" value="{$userinfo.oicq_no}" type="text">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table table-bordered">
                                    <colgroup>
                                        <col width="100">
                                        <col width="400">
                                    </colgroup>
                                    <thead>
                                        <tr>
                                            <td colspan="2">家庭信息</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_020.png">家庭住址：</td>
                                            <td>
                                                <input name="add_home" size="40" maxlength="100" class="layui-input" value="{$userinfo.add_home}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_021.png">家庭邮编：</td>
                                            <td>
                                                <input name="post_no_home" size="25" maxlength="25" class="layui-input" value="{$userinfo.post_no_home}" type="text">
                                            </td>
                                        </tr>
                                        <tr class="TableData">
                                            <td class="td-head"><img class="iconfont" src="/Public/Admin/images/user_022.png">家庭电话：</td>
                                            <td>
                                                <input name="tel_no_home" size="25" maxlength="25" class="layui-input" value="{$userinfo.tel_no_home}" type="text">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div style='margin-left:38%;'>
                                    <a class="layui-btn submitInfo" data-url="{:U('userinfo')}" data-form="">提交</a>
                                </div>
                            </form>
                        </div>
                        <div class="account" style="display:none;">
                            <form class="layui-form" id="form2" action="">
                                <table class="table table-bordered" width="500">
                                    <thead>
                                        <tr>
                                            <td colspan="2" class="Big"> <span class="">修改密码</span><br>
                                            </td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="Big">
                                            <td class="TableData" width="220px"><b><img src="/Public/Admin/images/user_008.png">用户名：</b></td>
                                            <td class="TableData"><b><input size="10" maxlength="10" class="layui-input" value="{$userinfo.user_id}" type="text" readonly style="cursor: not-allowed;background-color: #eeeeee;"></b></td>
                                        </tr>
                                        <tr>
                                            <td class="TableData"><img src="/Public/Admin/images/user_024.png">原密码：</td>
                                            <td class="TableData">
                                                <input name="pass0" size="10" maxlength="10" class="layui-input" value="" type="password">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="TableData"><img src="/Public/Admin/images/user_025.png">新密码：</td>
                                            <td class="TableData">
                                                <input name="pass1" size="10" maxlength="10" class="layui-input" value="" type="password"> 
                                                <span>1-12位</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="TableData"><img src="/Public/Admin/images/user_026.png">确认新密码：</td>
                                            <td class="TableData">
                                                <input name="pass2" size="10" maxlength="10" class="layui-input" value="" type="password"> 
                                                <span>1-12位 </span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div style='margin-left:38%;'>
                                    <a class="layui-btn submitAccount" data-url="{:U('setPass')}" data-form="">提交</a>
                                </div>
                            </form>
                        </div>
                        
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <!--<script type="text/javascript" src="/Public/Admin/js/common.js"></script>-->
    <script type="text/javascript" src="/Public/Admin/js/personal.js"></script>
    <script type="text/javascript">
        $(initPersonal());
        function get_animal_sign(){
            //根据输入的生日自动获取星座，生肖。
            var year = new Array("猪", "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗");
            jQuery(function () {
                var strHtml = "";
                var month = $("#BIR_MON_ID").val();
                var day = $("#BIR_DAY_ID").val()
                var con = getxingzuo(month, day);//
                var zodiac = year[(parseInt($("#BIR_YEAR_ID").val()) + 9) % 12];
                $("#animal_id").val(zodiac);
                $("#sign_id").val(con);
            })
        }
        
        //获取星座
        function getxingzuo(month, day) {
            var d = new Date(1999, month - 1, day, 0, 0, 0);
            var arr = [];
            arr.push(["魔羯座", new Date(1999, 0, 1, 0, 0, 0)])
            arr.push(["水瓶座", new Date(1999, 0, 20, 0, 0, 0)])
            arr.push(["双鱼座", new Date(1999, 1, 19, 0, 0, 0)])
            arr.push(["牡羊座", new Date(1999, 2, 21, 0, 0, 0)])
            arr.push(["金牛座", new Date(1999, 3, 21, 0, 0, 0)])
            arr.push(["双子座", new Date(1999, 4, 21, 0, 0, 0)])
            arr.push(["巨蟹座", new Date(1999, 5, 22, 0, 0, 0)])
            arr.push(["狮子座", new Date(1999, 6, 23, 0, 0, 0)])
            arr.push(["处女座", new Date(1999, 7, 23, 0, 0, 0)])
            arr.push(["天秤座", new Date(1999, 8, 23, 0, 0, 0)])
            arr.push(["天蝎座", new Date(1999, 9, 23, 0, 0, 0)])
            arr.push(["射手座", new Date(1999, 10, 22, 0, 0, 0)])
            arr.push(["魔羯座", new Date(1999, 11, 22, 0, 0, 0)])
            for (var i = arr.length - 1; i >= 0; i--) {
                if (d >= arr[i][1]) return arr[i][0];
            }
        }
        
    </script>
</block>
